﻿using System;
using System.Runtime.InteropServices;

namespace VSPackage1
{
    [Guid(GuidList.guidVSPackage1PkgString)]
    public class VSPackage1Package : VSPackage1PackageBase
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="ServiceType"></param>
        /// <returns>Code: <code>return base.GetService(ServiceType);</code></returns>
        public object GetServicePublic(Type ServiceType)
        {
            return base.GetService(ServiceType);
        }

        /// <summary>
        ///Returns the Extensions DTE2 in A VB.Net + C# Friendly way.
        ///
        /// Currently This only Works for C# *Cries* [You can use it in VB.NET just Not Expand it]
        /// </summary>
        /// <param name="ServiceType"></param>
        /// <returns>Code: <code>return (EnvDTE80.DTE2)base.GetService(typeof(Microsoft.VisualStudio.Shell.Interop.SDTE));</code></returns>
        public EnvDTE.DTE GetDTE2()
        {
            //This Seemed to fix the Problem of Expanding the COM Object...O.o

            //var Test = base.GetService(typeof(Microsoft.VisualStudio.Shell.Interop.SDTE));

            //		(EnvDTE80.DTE2)Test	Embedded interop type 'EnvDTE80.DTE2' is defined in both 'EnvDTE80.dll' and 'BaseProject.dll'. Some operations on objects of this type are not supported while debugging. Consider casting this object to type 'dynamic' when debugging or building with the 'Embed Interop Types' property set to false.
            //		(EnvDTE80.DTE2)Test	Embedded interop type 'EnvDTE80.DTE2' is defined in both 'EnvDTE80.dll' and 'ALinq.ORDesignerLoader.dll'. Some operations on objects of this type are not supported while debugging. Consider casting this object to type 'dynamic' when debugging or building with the 'Embed Interop Types' property set to false.
            //		(EnvDTE80.DTE2)Test	Embedded interop type 'EnvDTE80.DTE2' is defined in both 'EnvDTE80.dll' and 'ALinq.ORDesignerLoader.dll'. Some operations on objects of this type are not supported while debugging. Consider casting this object to type 'dynamic' when debugging or building with the 'Embed Interop Types' property set to false.

            //		(EnvDTE.DTE)base.GetService(typeof(Microsoft.VisualStudio.Shell.Interop.SDTE));	Embedded interop type 'EnvDTE.DTE' is defined in both 'VSPackage1.dll' and 'EnvDTE.dll'. Some operations on objects of this type are not supported while debugging. Consider casting this object to type 'dynamic' when debugging or building with the 'Embed Interop Types' property set to false.
            //		(EnvDTE.DTE)base.GetService(typeof(Microsoft.VisualStudio.Shell.Interop.SDTE));	Embedded interop type 'EnvDTE.DTE' is defined in both 'EnvDTE.dll' and 'NuGet.Tools.dll'. Some operations on objects of this type are not supported while debugging. Consider casting this object to type 'dynamic' when debugging or building with the 'Embed Interop Types' property set to false.

            return (EnvDTE.DTE)base.GetService(typeof(Microsoft.VisualStudio.Shell.Interop.SDTE));
        }

        protected override void Button1ExecuteHandler(object sender, EventArgs e)
        {
        }
    }
}